using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using Platform.Model;

namespace PlatformManagement
{
    public partial class MarketSelectorForm : DevComponents.DotNetBar.Metro.MetroForm
    {
        public MarketSelectorForm()
        {
            InitializeComponent();
        }

        public int MarketId { get; set; }

        private void btnOK_Click(object sender, EventArgs e)
        {
            MarketId = int.Parse(cmbMarket.SelectedValue.ToString());
        }

        private void MarketSelectorForm_Load(object sender, EventArgs e)
        {
            var lstMarket = Market.Objects.Where(x => x.ID != WorkSession.Current.Market.ID).ToList();
            cmbMarket.DataSource = new BindingSource() {DataSource = lstMarket};
            cmbMarket.DisplayMember = "MarketName";
            cmbMarket.ValueMember = "ID";
        }
    }
}